import QtQuick 2.15
import QtQuick.Window 2.15

Window {
    id: win
    visible: true
    title: "ITE演示客户端"

    width: Screen.width
    height: Screen.height

    readonly property int baseW: 1920
    readonly property int baseH: 1080

    readonly property real scaleFactor: Math.min(width / baseW, height / baseH)

    Shortcut {
        sequences: ["F11", "Ctrl+F"]
        onActivated: {
            if (win.visibility === Window.FullScreen) {
                win.visibility = Window.AutomaticVisibility;
            } else {
                win.visibility = Window.FullScreen;
            }
        }
    }

    Item {
        id: stage
        width: win.baseW
        height: win.baseH
        anchors.centerIn: parent
        scale: win.scaleFactor

        App {
            id: mainScreen
            anchors.fill: parent
        }
    }
}
